<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use App\Http\Extend\MethodExtend;

class BeforAction
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
        $METH = (explode("/", $request->getPathInfo()));
        !defined('_A_') && define('_A_', isset($METH[3]) ? $METH[3] : "index");
        !defined('_C_') && define('_C_', isset($METH[2]) ? $METH[2] : "index");
        !defined('_M_') && define('_M_', $METH[1]);
       
       
        return $next($request);
    }
}
